<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('语音服务商列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="product:provider:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="product:provider:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('product:provider:edit')}]];
        var removeFlag = [[${@permission.hasPermi('product:provider:remove')}]];
        var sys_languages = [[${@dict.getType('sys_languages')}]];
        var sys_sampling = [[${@dict.getType('sys_sampling')}]];
        var sys_bit = [[${@dict.getType('sys_bit')}]];
        var sys_track = [[${@dict.getType('sys_track')}]];
        var sys_format = [[${@dict.getType('sys_format')}]];
        var prefix = ctx + "product/provider";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/form",
                updateUrl: prefix + "/form/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "语音服务商",
                columns: [{
                    checkbox: false
                },
                {
                    field: 'id',
                    title: '${comment}',
                    visible: false
                },
                {
                    field: 'voiceUse',
                    title: '使用状态'
                },
                {
                    field: 'voiceName',
                    title: '服务商'
                },
                {
                    field: 'timeout',
                    title: '转写超时时间(秒)'
                },
                {
                    field: 'voiceLanguages',
                    title: '语种'
                },
                {
                    field: 'voiceSampling',
                    title: '采样率'
                },
                {
                    field: 'voiceBit',
                    title: 'Bit位'
                },
                {
                    field: 'voiceTrack',
                    title: '声道'
                },
                {
                    field: 'voiceDuration',
                    title: '时长'
                },
                {
                    field: 'voiceSize',
                    title: '文件大小'
                },
                {
                    field: 'voiceFormat',
                    title: '文件格式'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>